package cn.kgc.ssm.handlers;

import cn.kgc.ssm.utils.ResponseResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author 课工场
 * @date 2024/3/5
 * @description
 */
@RestControllerAdvice
public class GlobalExceptionHandler {


    @ExceptionHandler(Exception.class)
    public ResponseResult   allExceptionHandler(Exception e){

        e.printStackTrace();

        ResponseResult responseResult = new ResponseResult();
        responseResult.setMsg("服务器繁忙,请刷新重试");
        responseResult.setCode(500);
        return responseResult;

    }

}
